/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dto;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
import exceptions.EventException;

/**
 * An Text Event
 * 
 * @author Sebastian
 */
@DatabaseTable(tableName = "text_event")
public class TextEvent extends Event {

    private static final String TEXT_EMPTY = "Kein Text uebergeben";
    private static final String TEXT_TABLE_NAME = "text";
    
    @DatabaseField(columnName = TEXT_TABLE_NAME)
    private String text;
    
    public TextEvent() {
        super();
    } // Needed for OrmLite
    
    public TextEvent (Track track, String description, long timestamp, GeoPoint pos, String text) throws EventException {
        super(track, description, timestamp, pos);
        
        setText(text);
    }
    
    
    public String getText() {
        return text;
    }

    public void setText(String text) {
        if (text == null) throw new IllegalArgumentException(TEXT_EMPTY);
        this.text = text;
    }
    
}
